import SizeEnums from '@/model/enums/SizeEnums'
import BtnTypeEnums from '@/model/enums/BtnTypeEnums'
class BtnModel {
    /**
     * 按钮文本
     */
    public label: string = 'test'
    /**
     * 按钮点击事件
     */
    public click: Function = () => { }
    /**
     * 尺寸
     */
    public size?: SizeEnums = SizeEnums.default
    /**
     * 按钮类型
     */
    public type?: BtnTypeEnums = BtnTypeEnums.info

    public static danger = (label: string, click: Function, size: SizeEnums = SizeEnums.default): BtnModel => {
        return {
            label,
            click,
            size,
            type: BtnTypeEnums.danger
        }
    }

    public static warning = (label: string, click: Function, size: SizeEnums = SizeEnums.default): BtnModel => {
        return {
            label,
            click,
            size,
            type: BtnTypeEnums.warning
        }
    }

    public static success = (label: string, click: Function, size: SizeEnums = SizeEnums.default): BtnModel => {
        return {
            label,
            click,
            size,
            type: BtnTypeEnums.success
        }
    }

    public static primary = (label: string, click: Function, size: SizeEnums = SizeEnums.default): BtnModel => {
        return {
            label,
            click,
            size,
            type: BtnTypeEnums.primary
        }
    }

    public static text = (label: string, click: Function, size: SizeEnums = SizeEnums.default): BtnModel => {
        return {
            label,
            click,
            size,
            type: BtnTypeEnums.text
        }
    }

    public static info = (label: string, click: Function, size: SizeEnums = SizeEnums.default): BtnModel => {
        return {
            label,
            click,
            size,
            type: BtnTypeEnums.info
        }
    }
}
export default BtnModel